]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dateMenu: Bind pad visibility to indicator
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 21 Jan 2020 15:36:56 +0000 (16:36 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 22 Jan 2020 21:55:28 +0000 (21:55 +0000)
Currently the indicator pad requests a size of 0x0 if the corresponding
indicator is hidden. Right now this is enough to balance out the indicator,
but it won't be when we add spacing to the parent container.

Properly hide the pad with the indicator to avoid that issue.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/239

js/ui/dateMenu.js

index 1fd6ccdbc22cf3ddee3403e7808976bd6f09309d..690d30f4bca4feeb84f67e656af45feee5c55d10 100644 (file)
@@ -473,21 +473,19 @@ var IndicatorPad = GObject.registerClass(
 class IndicatorPad extends St.Widget {
     _init(actor) {
         this._source = actor;
-        this._source.connect('notify::visible', () => this.queue_relayout());
         this._source.connect('notify::size', () => this.queue_relayout());
         super._init();
+        this._source.bind_property('visible',
+            this, 'visible',
+            GObject.BindingFlags.SYNC_CREATE);
     }
 
     vfunc_get_preferred_width(forHeight) {
-        if (this._source.visible)
-            return this._source.get_preferred_width(forHeight);
-        return [0, 0];
+        return this._source.get_preferred_width(forHeight);
     }
 
     vfunc_get_preferred_height(forWidth) {
-        if (this._source.visible)
-            return this._source.get_preferred_height(forWidth);
-        return [0, 0];
+        return this._source.get_preferred_height(forWidth);
     }
 });